#include "point.h"
#include <stdlib.h>

Point2 zero2 = {0, 0};
Point3 zero3 = {0, 0, 0};
Point3 direction3[] = {
    {-1,  0,  0},
    { 1,  0,  0},
    { 0, -1,  0},
    { 0,  1,  0},
    { 0,  0, -1},
    { 0,  0,  1}
};

Point2 Point2i(int x, int y){
    Point2 p;

    p.x = x;
    p.y = y;

    return p;
}

Point3 Point3i(int x, int y, int z){
    Point3 p;

    p.x = x;
    p.y = y;
    p.z = z;

    return p;
}

Point3 Point3Add( Point3 pt1, Point3 pt2){
    return Point3i(
            pt1.x + pt2.x,
            pt1.y + pt2.y,
            pt1.z + pt2.z);
}

Point3 Point3Sub( Point3 pt1, Point3 pt2){
    return Point3i(
            pt1.x - pt2.x,
            pt1.y - pt2.y,
            pt1.z - pt2.z);
}

Point3 Point3Abs(Point3 pt1){
    return Point3i(
            abs(pt1.x),
            abs(pt1.y),
            abs(pt1.z) );
}

Point3 Point3Op(Point3 pt1){
    return Point3i(
            1 - pt1.x,
            1 - pt1.y,
            1 - pt1.z);
}
